#include <stdio.h>
int removeDuplicates(int* nums, int len) 
{
      int pos =1;
      for(int idx=1;idx<len;idx++)
      {
        if(nums[idx]!=nums[idx-1])
        {
            nums[pos++]=nums[idx];
        }
      }
      return pos;
}

int main()
{
    int nums[] = {0,0,1,1,1,2,2,3,3,4};
    int newlen = removeDuplicates(nums,sizeof(nums)/sizeof(nums[0]));
    for(int i=0;i<newlen;i++)
    {
        printf("%d ",nums[i]);
    }
    return 0;

}